import { get, post } from "./http.js";


// ========================菜单管理=========================
// 添加
export const menuAdd = (params)=> post("/api/menuadd",params)
// 列表
export const menuList = (params)=> get("/api/menulist",params)
// 删除
export const menuDel = (params)=> post("/api/menudelete",params)
// 获取一条信息
export const menuInfo = (params)=> get("/api/menuinfo",params)
// 编辑
export const menuEdit = (params)=> post("/api/menuedit",params)
// ========================角色管理=========================
//角色添加
export const roleAdd = (params)=> post("/api/roleadd",params)
//角色列表
export const roleList = ()=> get("/api/rolelist")
//角色删除
export const roleDel = (params)=> post("/api/roledelete",params)
//角色编辑
export const roleEdit = (params)=> post("/api/roleedit",params)
//一条数据
export const roleinfo = (params)=> get ("/api/roleinfo",params)

// ========================管理员管理=========================
//管理员添加
export const manageAdd = (params)=> post("/api/useradd",params)
//管理员总数（用于计算分页）
export const manageCount = ()=> get ("/api/usercount")
//管理员列表（分页）
export const manageList = (params)=> get ("/api/userlist",params)
//管理员获取（一条）
export const manageInfo = (params)=> get ("/api/userinfo",params)
//管理员修改
export const manageEdit = (params)=> post("/api/useredit",params)
//管理员删除
export const manageDel = (params)=> post("/api/userdelete",params)
//管理员登录
export const manageLogin = (params)=> post("/api/userlogin",params)


// ========================商品分类=========================
//商品添加
export const cateAdd = (params)=> post("/api/cateadd",params,true)
//商品分类
export const cateList = (params)=> get ("/api/catelist",params)
//商品分类获取（一条）
export const cateInfo = (params)=> get ("/api/cateinfo",params)
//商品分类修改
export const cateEdit = (params)=> post("/api/cateedit",params,true)
//商品分类删除
export const cateLete = (params)=> post("/api/catedelete",params)

// ========================商品规格=========================
//商品规格添加
export const specsAdd = (params)=> post("/api/specsadd",params)
//商品规格总数（用于计算分页）
export const specsCount = ()=> get ("/api/specscount")
//商品规格列表（分页）
export const specsList = (params)=> get ("/api/specslist",params)
//商品规格获取（一条）
export const specsInfo = (params)=> get ("/api/specsinfo",params)
//商品规格修改
export const specsEdit = (params)=> post("/api/specsedit",params)
//商品规格删除
export const specsDel = (params)=> post("/api/specsdelete",params)

// ========================商品管理=========================
//商品添加
export const goodsAdd = (params)=> post("/api/goodsadd",params,true)
//商品总数（用于计算分页）
export const goodsCount = ()=> get ("/api/goodscount")
//商品列表（分页）
export const goodsList = (params)=> get ("/api/goodslist",params)
//商品获取（一条）
export const goodsInfo = (params)=> get ("/api/goodsinfo",params)
//商品修改
export const goodsEdit = (params)=> post("/api/goodsedit",params,true)
//商品删除
export const goodsDel = (params)=> post("/api/goodsdelete",params)

// ========================会员管理=========================
//会员列表
export const memberList = ()=> get ("/api/memberlist")
//会员获取（一条）
export const memberInfo = (params)=> get ("/api/memberinfo",params)
//会员编辑
export const memberEdit = (params)=> post("/api/memberedit",params)

// ========================轮播图管理=========================
//轮播图添加
export const bannerAdd = (params)=> post("/api/banneradd",params,true)
//轮播图列表
export const bannerList = ()=> get ("/api/bannerlist")
//轮播图获取（一条）
export const bannerInfo = (params)=> get ("/api/bannerinfo",params)
//轮播图修改
export const bannerEdit = (params)=> post("/api/banneredit",params,true)
//轮播图删除
export const bannerDel = (params)=> post("/api/bannerdelete",params)

// ========================限时秒杀=========================
//限时秒杀添加
export const seckillAdd = (params)=> post("/api/seckadd",params)
//限时秒杀列表
export const seckillList = ()=> get ("/api/secklist")
//限时秒杀获取（一条）
export const seckillInfo = (params)=> get ("/api/seckinfo",params)
//限时秒杀修改
export const seckillEdit = (params)=> post("/api/seckedit",params)
//限时秒杀删除
export const seckillDel = (params)=> post("/api/seckdelete",params)